package com.easyschool.webservices.adapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import com.easyschool.tools.Constants;

public class WSBooleanAdapter extends XmlAdapter<String, Boolean> {


	
    @Override
    public Boolean unmarshal(String v) throws Exception {
        return Constants.YES.equals(v);
    }

    @Override
    public String marshal(Boolean v) throws Exception {
        return v.booleanValue()?Constants.YES:Constants.NO;
    }

}
